package com.trainbook.controller;


import com.trainbook.common.result.JsonResult;
import com.trainbook.service.IUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author Dempsey
 * @since 2020-11-27
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @ResponseBody
    @PostMapping("/login")
    @ApiImplicitParams(value={@ApiImplicitParam(name="username",value = "用户名",required = true),
            @ApiImplicitParam(name="password",value = "密码",required = true)
    })
    public JsonResult login(@RequestParam String username,
                            @RequestParam String password){
        return userService.login(username,password);
    }



}

